package RPGame;
import java.awt.Color;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;

public class Game extends BasicGame{

	public EntityPlayer player;
	
	public Game() {
		super("RPGame");
	}

	@Override
	public void render(GameContainer gc, Graphics g) throws SlickException {
		g.setBackground(org.newdawn.slick.Color.gray);
		player.render();
		
	}

	@Override
	public void init(GameContainer container) throws SlickException {
		player = new EntityPlayer(this);
		
	}

	@Override
	public void update(GameContainer container, int delta)
			throws SlickException {
		player.update(delta);
	}
	
	@Override
	public void keyPressed(int key, char c) {
		player.keyPressed(key, c);
	}
	
	@Override
	public void keyReleased(int key, char c) {
		player.keyReleased(key, c);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		AppGameContainer game;
		try {
			Game rpGame = new Game();
			game = new AppGameContainer(rpGame);
			game.setShowFPS(true);
			game.setDisplayMode(800, 480, false);
			game.start();
		} catch (SlickException e) {
			e.printStackTrace();
		}
	}

}
